package com.rocky.ssm.controller;

import com.rocky.ssm.model.User;
import com.rocky.ssm.service.IUserService;
import org.apache.maven.model.Model;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * Created by Administrator on 2017/8/9.
 */

@Controller
@RequestMapping("/students")
public class StudentEvaluation {
/*
    @Autowired
    private IUserService userService;

    @RequestMapping("/evaluationList")
    public String list(Model model){
        //StudentEvaluation studentsEvaluation = null;
        // List<studentsEvaluation> list=studentsService.list()
        //model.addAttribute("studentsList",list);
        return "students/evaluationList";
    }

    @RequestMapping("/{id}/evaluationUpdate")
    public String update(@PathVariable int id,Model model){
        //StudentEvaluation studentsEvaluation =studentsService.getById(id)
        //model.addAttribute("studentsEvaluation",studentsEvaluation);
        return "students/evaluationUpdate";
    }

    @RequestMapping(value = "/update",method = RequestMethod.POST)
    public String doUpdate(StudentEvaluation studentsEvaluation){
        int result=0;
        //int result=studentsService.upDate(studentsEvaluation);
        if (result>0)
            return "redirect:students/evaluationList";
        else
            return "students/evaluationUpdate";
    }

    @RequestMapping("/evaluationDelete")
    public String delete(@PathVariable int id){
        //int result=studentsService.delete(id)
        return "redirect:students/evaluationList";
    }

    @RequestMapping(value = "/evaluationAdd",method = RequestMethod.POST)
    public String add(StudentEvaluation studentsEvaluation){
        int result=0;
        //int result=studentsService.save(studentsEvaluation);
        if (result>0)
            return "redirect:students/evaluationList";
        else
            return "students/evaluationAdd";
    }*/


}
